MPEG, for example, is well known as technology for compressing picture information. MPEG is technology for compressing moving picture information using processing such as motion compensation prediction encoding, Discrete Cosine Transform (DCT), quantization and variable length encoding. MPEG1 and MPEG2 exist as implementations of MPEG.
FIG. 11 is a schematic diagram showing the structure of an MPEG picture. A moving picture is made up of a plurality of still pictures. Each still picture comprises a plurality of pixels arrayed in horizontal and vertical directions. A still picture is divided into macro blocks comprising 16×16 pixels. In the example shown in FIG. 11, a still picture is divided up into 12×7 macro blocks. Two-dimensional coordinates (m, n) are attached to each macro block.
m is the coordinate for the horizontal direction, while n is the coordinate for the vertical direction. Coordinates of the macro block at the upper left end of the still picture screen are (1,1), and these are the origin coordinates.
With MPEG, overall picture information corresponding to one still screen is called a picture. One picture contains at least one slice. In the example of FIG. 11, a picture contains 5 slices (slice 1-slice 5). One slice contains at least one macro block. A slice is a set of macro blocks. That is, picture information has a layer structure composed of picture, slices and macro blocks.
Motion compensation prediction encoding, quantization and variable length encoding are carried out in macro block units. Discrete cosine transform is achieved by dividing a macro block into blocks, each comprising 8×8 pixels.
This series of compression processing operations is carried out sequentially in a horizontal direction from the macro block at the origin. If the right edge macro bock is then compressed, the next horizontal string is sequentially compressed from the left edge macro block.
In the example shown in FIG. 11, macro block (1,1) is initially compressed, and next the macro block (2,1) is compressed. If macro block (12,1) is compressed, then macro block (1, 2) is compressed next. Accordingly, macro blocks included in the same slice are continuous in the horizontal direction. With MPEG1, macro blocks included in the same slice are sometimes divided across two or more horizontal rows. (FIG. 11) Conversely, with MPEG2, macro blocks included in the same slice are always contained in the same horizontal row.
With MPEG, serial data is generated from picture information that has been compression encoded. MPEG serial data has a layer structure, corresponding to the layer structure of the picture. FIG. 12 is a schematic drawing showing the MPEG1 data structure. An encoded signal of the overall moving picture information is called a sequence. A sequence contains one sequence header, at least one GOP (group of pictures) and one sequence end. Each GOP contains one GOP header and at least one picture. Each picture contains one picture header and at least one slice. Each slice contains one item of slice information and at least one macro block. Each macro block then contains one item of macro block information and at least one block. DCT encoded data is stored in a block.
Decoding of MPEG picture information is carried out in the reverse order to encoding. Specifically, decoding of variable length code inverse quantization, inverse discrete cosine transform and motion compensation processing are sequentially executed. In each of these processing operations, the macro block processing order is the same as for the case of encoding processing. Specifically, a series of decoding processes is executed sequentially in the horizontal direction from the macro block of the origin (1,1).
As described above, the origin coordinate for macro block position control is (1,1), and not (0,0). However, in the event that the origin coordinate is determined to be (1,1), there is a problem that a motion compensation processing circuit and a variable length code decoding processing circuit become complicated.
With motion compensation processing, motion compensation for a particular picture is sometimes carried out with reference to another picture. For this reason, the picture referred to is temporarily stored in a frame memory after being decoded. In a normal memory, addresses begin at ‘0’. Accordingly, when storing a picture for reference in the frame memory, it is necessary to respectively subtract ‘1’ from the horizontal and vertical position coordinates of the macro block. For this reason, it is necessary to provide two subtractors in the motion compensation circuit.
With variable length encoding processing, when skipped macro block processing is performed, it is necessary to control the positional coordinates of the macro block. For this reason, after processing for macro blocks at the right end has been completed, the horizontal direction coordinate must be reset to ‘1’, but a counter circuit for resetting to ‘1’ has a complicated structure compared to a normal counter circuit, namely a counter circuit for resetting to ‘0’.
Also, with variable length decoding processing, bit stream error concealment processing is carried out. With this error concealment processing, control is carried out for whether or not the coordinates of the macro block are the currently existing coordinates. With the example in FIG. 11, a case where the horizontal coordinate is greater than ‘12’ or the vertical coordinate is greater than ‘7’ will constitute an error. Also, since the origin coordinates are (1,1), the case where the horizontal coordinate or the vertical coordinate is ‘0’ will also constitute an error. Accordingly, since the origin coordinates are (1,1), it is necessary to check whether the horizontal coordinate or the vertical coordinate is ‘0’, which complicates the circuitry.